/***************************************************************************
 * Open Object Oriented ANSI C                                             *
 ***************************************************************************
 * Code given under the terms of GNU General Public Licence (GPLv3)        *
 * and without any waranties of any kind including but not limitative to   *
 * waranties on merchandability or any particular applications fitness.    *
 * For more information on GNU/GPL go on :                                 *
 * "http://www.gnu.org/copyleft/gpl.html"                                  *
 *                                                                         *
 * You are allowed to use it for any purposes in the terms of GNU/GPLv3    *
 * (or more).                                                              *
 * This text MUST stay in state on copyed sources (or sources using it)    *
 * and must not be altered.                                                *
 * You are allowed to add your name at the end of the Copylefs list.       *
 ***************************************************************************
 * Copylefts List :                                                        *
 ***************************************************************************
 * 2010-04-16 Patrick PIGNOL <pignol_patrick@hotmail.com> (Original)       *
 * (Type your name here if needed)                                         *
 ***************************************************************************/
#ifndef EVENTARGS_H
#define EVENTARGS_H
#define EVENTARGS_TYPEID 8

typedef struct EventArgs EventArgs;
typedef struct EventArgsInterface EventArgsInterface;
typedef struct EventArgsVirtualTable EventArgsVirtualTable;

#include "Mem.h"
#include "Class.h"

struct EventArgsVirtualTable
{
    unsigned long int TypeID;
    EventArgsInterface* Interface;
    ClassVirtualTable* AncestorTable;
    unsigned long int ReferenceCount;
    EventArgs* (*new)(unsigned long pArgsCount, va_list* pParameters);
    EventArgsVirtualTable* (*Initialize)(EventArgs* this, unsigned long pArgsCount, va_list* pParameters);
    void (*Garbage)(EventArgs* this);
    unsigned long int (*TypeOf)(EventArgs* this);
    bool (*IsSameTypeThanTypeID)(EventArgs* this, unsigned long int pTypeID);
    bool (*IsKindOfTypeID)(EventArgs* this, unsigned long int pTypeID);
    bool (*IsSameTypeThan)(EventArgs* this, Class* pSource);
    bool (*IsKindOf)(EventArgs* this, Class* pSource);
};

struct EventArgsInterface
{
    void (*Constructor)(EventArgs* this, unsigned long int pArgsCount, va_list* pParameters);
    void (*Destructor)(EventArgs* this);
    EventArgs* (*Clone)(EventArgs* this);
};

struct EventArgs
{
    EventArgsVirtualTable* VirtualTable;
    void (*Constructor)(EventArgs* this, unsigned long int pArgsCount, va_list* pParameters);
    void (*Destructor)(EventArgs* this);
    EventArgs* (*Clone)(EventArgs* this);
};

EventArgs* EventArgsNew(unsigned long pArgsCount, va_list* pParameters);
EventArgsVirtualTable* EventArgsInitialize(EventArgs* this, unsigned long pArgsCount, va_list* pParameters);
void EventArgsConstructor(EventArgs* this, unsigned long int pArgsCount, va_list* pParameters);
void EventArgsDestructor(EventArgs* this);
EventArgs* EventArgsClone(EventArgs* this);

#endif /* EVENTARGS_H */
